package org.cuatrovientos.erp.model;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

public class User {
@Min(value=1,message="{user.id.error}")	
private int id;
@Size(min=5,max=30,message="{user.login.error}")
@NotNull(message="{user.login.error}")
 private String login;
@Size(min=5,max=100,message="{user.password.error}")
@NotNull(message="{user.password.error}")
 private String password;
@Size(min=5,max=100,message="{user.name.error}")
@NotNull(message="{user.name.error}")
 private String name;
@Pattern(regexp="^([a-zA-Z0-9\\-\\.\\_]+)'+'(\\@)([a-zA-Z0-9\\-\\.]+)'+'(\\.)([a-zA-Z]{2,4})$",message="{user.email.error}")
@Size(min=5,max=100,message="{user.email.error}") 
private String email;
@Min(value=1,message="{user.idrole.error}")	
private int idrole;


public User(int id, String login, String password, String name, String email,
		int idrole) {
	super();
	this.id = id;
	this.login = login;
	this.password = password;
	this.name = name;
	this.email = email;
	this.idrole = idrole;
}

public User(){
	
}

public int getId() {
	return id;
}
public void setId(int id) {
	this.id = id;
}
public String getLogin() {
	return login;
}
public void setLogin(String login) {
	this.login = login;
}
public String getPassword() {
	return password;
}
public void setPassword(String password) {
	this.password = password;
}
public String getName() {
	return name;
}
public void setName(String name) {
	this.name = name;
}
public String getEmail() {
	return email;
}
public void setEmail(String email) {
	this.email = email;
}
public int getIdrole() {
	return idrole;
}
public void setIdrole(int idrole) {
	this.idrole = idrole;
}

}
